package com.ruoyi.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class RedeemCodeEntity {

    private int id;

    private String key;

    private int tokens;

    private int chatCount;

    private int advancedChatCount;

    private int drawCount;

    private int days;

    private int calcTypeId;

    private PackageEntity.CalcType calcType;

    private String channel;

    private String remark;

    private int state;

    private int redeemState;

    private int userId; // 兑换给谁

    private int operatorId; // 谁负责兑换的（可能是后台管理员帮忙兑换）

    private int creatorId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date redeemTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date cancelTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date deleteTime;


    public static final int STATE_DRAFT = 0; // 草稿
    public static final int STATE_NORMAL = 1; // 生效
    public static final int STATE_CANCELLED = 2; // 作废
    public static final int STATE_DELETED = 3; // 删除

    public static final int REDEEM_STATE_VALID = 0; //  未兑换，有效
    public static final int REDEEM_STATE_INVALID = 1; // 已兑换，无效

    private String creatorName;

    private String username;

    private String userEmail;

    private String creatorEmail;


}
